﻿@{
    ViewBag.Title = "Index";
    ViewBag.Active = "Reportes";
}
<h2>
    Reportes</h2>
<div class="row-fluid" id="ExamenesBinding">
    <div class="span4">
        <div class="span12" id="smallUserDetail">
            <div class="span4">
                <img class="thumbnail" src="/Content/images/small_user_placeholder.jpg" />
            </div>
            <div class="span8" data-bind="with: IndividuoDetalle">
                <h3>
                    <span data-bind="text: $parent.NombreCompleto"></span>
                </h3>
                <p>
                    <a href="mailto:#"><span data-bind="text: Email"></span></a>
                </p>
                <dl class="dl-horizontal">
                    <dt>No Identificacion</dt>
                    <dd>
                        <span data-bind="text: NoIdentificacion"></span>
                    </dd>
                    <dt>Grupo Sanguineo</dt>
                    <dd>
                        <span data-bind="text: GrupoSanguineo"></span>
                    </dd>
                    <dt>Fecha Nacimiento</dt>
                    <dd>
                        <span data-bind="date: FechaNacimiento"></span>
                    </dd>
                </dl>
            </div>
        </div>
    </div>
    <div class="span8">
        <h3>
            Reportes Disponibles</h3>
        <div data-bind="with: ExamenesVM">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>
                            No. Id
                        </th>
                        <th>
                            Fecha
                        </th>
                        <th>
                            Tipo
                        </th>
                        <th>
                        </th>
                    </tr>
                </thead>
                <tbody data-bind="foreach: PagedRows">
                    <tr>
                        <td>
                            <span data-bind="text: Id"></span>
                        </td>
                        <td>
                            <span data-bind="text: FechaCreacion"></span>
                        </td>
                        <td>
                            <span data-bind="text: Tipo"></span>
                        </td>
                        <td>
                            <div class="btn-group">
                                <a class="btn btn-info" target="_blank" data-bind="attr: { href: '/Reporte/MostrarCertificado/' + $data.Id + '/?tipo=' + $data.Tipo + '&individuo=' + $data.IndividuoId }">
                                    <i class="icon-search icon-white"></i>&nbsp;Mostrar</a><a class="btn btn-info" target="_blank"
                                        data-bind="attr: { href: '/Reporte/ImprimirCertificado/' + $data.Id + '/?tipo=' + $data.Tipo + '&individuo=' + $data.IndividuoId }">
                                        <i class="icon-print icon-white"></i>&nbsp;Imprimir</a>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
            <a href="#" data-bind="click: PreviousPage, visible: PageIndex() > 0">Anterior</a>
            <a href="#" data-bind="click: NextPage, visible: PageIndex() < MaxPageIndex()">Siguiente</a></div>
    </div>
</div>
@section ViewScripts{
    <script src="@Url.Content("~/Scripts/views/reporte/editor.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
          startApp(@ViewBag.UserId);
        });
    </script>
}
